Optimal. Leaf size=287 \[ \frac {b (A b (3+m)+a B (4+m)) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (3+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x)) \sin (e+f x)}{c f (3+m)}-\frac {\left (A b^2 (1+m)+2 a b B (1+m)+a^2 A (2+m)\right ) (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c f (1+m) (2+m) \sqrt {\sin ^2(e+f x)}}-\frac {\left (b^2 B (2+m)+a (2 A b+a B) (3+m)\right ) (c \cos (e+f x))^{2+m} \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c^2 f (2+m) (3+m) \sqrt {\sin ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.36, antiderivative size = 287, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {3069, 3102,
2827, 2722} \begin {gather*} -\frac {\sin (e+f x) \left (a^2 A (m+2)+2 a b B (m+1)+A b^2 (m+1)\right ) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{c f (m+1) (m+2) \sqrt {\sin ^2(e+f x)}}-\frac {\sin (e+f x) \left (a (m+3) (a B+2 A b)+b^2 B (m+2)\right ) (c \cos (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{c^2 f (m+2) (m+3) \sqrt {\sin ^2(e+f x)}}+\frac {b \sin (e+f x) (a B (m+4)+A b (m+3)) (c \cos (e+f x))^{m+1}}{c f (m+2) (m+3)}+\frac {b B \sin (e+f x) (a+b \cos (e+f x)) (c \cos (e+f x))^{m+1}}{c f (m+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 2827
Rule 3069
Rule 3102
Rubi steps
\begin {align*} \int (c \cos (e+f x))^m (a+b \cos (e+f x))^2 (A+B \cos (e+f x)) \, dx &=\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x)) \sin (e+f x)}{c f (3+m)}+\frac {\int (c \cos (e+f x))^m \left (a c (b B (1+m)+a A (3+m))+c \left (b^2 B (2+m)+a (2 A b+a B) (3+m)\right ) \cos (e+f x)+b c (A b (3+m)+a B (4+m)) \cos ^2(e+f x)\right ) \, dx}{c (3+m)}\\ &=\frac {b (A b (3+m)+a B (4+m)) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (3+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x)) \sin (e+f x)}{c f (3+m)}+\frac {\int (c \cos (e+f x))^m \left (c^2 (a (2+m) (b B (1+m)+a A (3+m))+b (1+m) (A b (3+m)+a B (4+m)))+c^2 (2+m) \left (b^2 B (2+m)+a (2 A b+a B) (3+m)\right ) \cos (e+f x)\right ) \, dx}{c^2 (2+m) (3+m)}\\ &=\frac {b (A b (3+m)+a B (4+m)) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (3+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x)) \sin (e+f x)}{c f (3+m)}+\frac {\left (A b^2 (1+m)+2 a b B (1+m)+a^2 A (2+m)\right ) \int (c \cos (e+f x))^m \, dx}{2+m}+\frac {\left (b^2 B (2+m)+a (2 A b+a B) (3+m)\right ) \int (c \cos (e+f x))^{1+m} \, dx}{c (3+m)}\\ &=\frac {b (A b (3+m)+a B (4+m)) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (3+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x)) \sin (e+f x)}{c f (3+m)}-\frac {\left (A b^2 (1+m)+2 a b B (1+m)+a^2 A (2+m)\right ) (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c f (1+m) (2+m) \sqrt {\sin ^2(e+f x)}}-\frac {\left (b^2 B (2+m)+a (2 A b+a B) (3+m)\right ) (c \cos (e+f x))^{2+m} \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c^2 f (2+m) (3+m) \sqrt {\sin ^2(e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.77, size = 217, normalized size = 0.76 \begin {gather*} \frac {\cos (e+f x) (c \cos (e+f x))^m \left (-\frac {a^2 A \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right )}{1+m}+\cos (e+f x) \left (-\frac {a (2 A b+a B) \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right )}{2+m}+b \cos (e+f x) \left (-\frac {(A b+2 a B) \, _2F_1\left (\frac {1}{2},\frac {3+m}{2};\frac {5+m}{2};\cos ^2(e+f x)\right )}{3+m}-\frac {b B \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {4+m}{2};\frac {6+m}{2};\cos ^2(e+f x)\right )}{4+m}\right )\right )\right ) \sin (e+f x)}{f \sqrt {\sin ^2(e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.67, size = 0, normalized size = 0.00 \[\int \left (c \cos \left (f x +e \right )\right )^{m} \left (a +b \cos \left (f x +e \right )\right )^{2} \left (A +B \cos \left (f x +e \right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (c\,\cos \left (e+f\,x\right )\right )}^m\,\left (A+B\,\cos \left (e+f\,x\right )\right )\,{\left (a+b\,\cos \left (e+f\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________